<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试vue2</title>
</head>

<body>
    <div id="app">
        <span>1111</span>
        {{allName}}
    </div>
    <script type="text/javascript" src="/dist/umd/vue.js"></script>
    <script>
        let vm = new Vue({
            el: "#app",
            data:{
                name: 'hello',
                age: 12
            },
            computed:{
                allName(){
                    console.log("run");
                    return this.name +"_"+ this.age;
                }
            }
        });
        vm.allName;
        vm.allName;
        setTimeout(()=>{
            vm.name = "world";
            vm.allName;
        }, 1000)
        // setTimeout(()=>{
        //     vm.name = 'world';
        //     vm.name = '123';
        // },2000)
    </script>
</body>

</html>